from models import db, BaseModel


class User(BaseModel):
    """
    用户模型
    """
    __tablename__ = "sys_user"
    __table_args__ = ({"comment": "用户"})
    userName = db.Column(db.String, name="user_name", unique=False, nullable=True, comment="用户名")
    realName = db.Column(db.String, name="real_name", unique=False, nullable=True, comment="姓名")
    nickName = db.Column(db.String, name="nick_name", unique=False, nullable=True, comment="昵称")
    avatar = db.Column(db.String, name="avatar", unique=False, nullable=True, comment="用户头像")
    password = db.Column(db.String, name="password", unique=False, nullable=True, comment="用户密码")
    salt = db.Column(db.String, name="salt", unique=False, nullable=True, comment="密码加盐")
    mobilePhone = db.Column(db.String, name="mobile_phone", unique=False, nullable=True, comment="手机号")
    tel = db.Column(db.String, name="tel", unique=False, nullable=True, comment="联系电话")
    email = db.Column(db.String, name="email", unique=False, nullable=True, comment="邮箱")
    adminType = db.Column(db.Integer, name="admin_type", unique=False, nullable=True, comment="管理员类型<sys_admin_type>", default=2)
    sex = db.Column(db.Integer, name="sex", unique=False, nullable=True, comment="性别<sys_sex>")
    isLocked = db.Column(db.Integer, name="is_locked", unique=False, nullable=True, comment="是否锁定", default=0)
    deptId = db.Column(db.BigInteger, name="dept_id", unique=False, nullable=True, comment="所属部门")
    postId = db.Column(db.BigInteger, name="post_id", unique=False, nullable=True, comment="所属岗位")
    remark = db.Column(db.String, name="remark", unique=False, nullable=True, comment="备注")
